sc_trim_barcodeassume read1 contains the transcript
N in its barcode or UMI:
FALSEsc_exon_mappingsc_demultiplexsc_gene_countingThe organism is “mmusculus_gene_ensembl”, and gene id type is “ensembl_gene_id”.
if (is.null(params$organism) || is.na(params$organism)) {
sce = create_sce_by_dir(params$outdir)
} else {
sce = create_sce_by_dir(params$outdir, organism=params$organism, gene_id_type=params$gene_id_type)
}
overall_stat = demultiplex_info(sce)
datatable(overall_stat, width=800)
Plot barcode match statistics in pie chart:
plot_demultiplex(sce)
ggplotly(plot_mapping(sce, dataname=params$samplename, percentage = FALSE))
ggplotly(plot_mapping(sce, dataname=params$samplename, percentage = TRUE))
if (any(colSums(counts(sce)) == 0)) {
zero_cells = sum(colSums(counts(sce)) == 0)
sce = sce[, colSums(counts(sce)) > 0]
} else {
zero_cells = 0
}
Datatable of all QC metrics:
sce = calculate_QC_metrics(sce)
cannot connect to the ensembl database. ERROR:
Error in useMart("ensembl"): could not find function "useMart"
Try to use org.Mm.eg.db.
'select()' returned 1:many mapping between keys and columns
cannot connect to the ensembl database. ERROR:
Error in useMart("ensembl"): could not find function "useMart"
Try to use org.Mm.eg.db.
'select()' returned 1:many mapping between keys and columns
if(!all(colSums(as.data.frame(QC_metrics(sce)))>0)){
QC_metrics(sce) = QC_metrics(sce)[, colSums(as.data.frame(QC_metrics(sce)))>0]
}
datatable(as.data.frame(QC_metrics(sce)), width=800, options=list(scrollX= TRUE))
Summary of all QC metrics:
datatable(do.call(cbind, lapply(QC_metrics(sce), summary)), width=800, options=list(scrollX= TRUE))
Number of reads mapped to exon before UMI deduplication VS number of genes detected:
ggplotly(ggplot(as.data.frame(QC_metrics(sce)), aes(x=mapped_to_exon, y=number_of_genes))+geom_point(alpha=0.8))
knitr::knit_exit()